#include <iostream>
#include <math.h>
using namespace std;
typedef struct
{
double re;
double im;
} Complex;
Complex suma2;
Complex *suma = new Complex();
double modul(Complex *a);
double arg(Complex *a);
void adcomplex(Complex *a, Complex*b);
void adcomplex(Complex a, Complex b);
Complex diff(Complex a, Complex b);
bool equals(Complex *a, Complex *b);
bool null(Complex *a, Complex *ZERO);
int main()
{
    Complex *a = new Complex();
    Complex *b = new Complex();
    cout<<"Coef real pt a:"; cin>>a->re;
    cout<<"Coef img pt a:"; cin>>a->im;
    cout<<"Coef real pt b:"; cin>>b->re;
    cout<<"Coef img pt b:"; cin>>b->im;
    cout<<"Modulul lui a este:"<<modul(a)<<endl;
    cout<<"Argumentul lui b este:"<<arg(b)<<endl;
    adcomplex(a,b);
    cout<<"Partea reala a lui a+b:"<<suma->re<<endl<<"Partea imaginara a lui a+b"<<suma->im<<endl;
    cout<<equals(a,b)<<endl;
    return 0;
}

double modul(Complex *a)
{
    return sqrt(a->re*a->re+a->im*a->im);
}
double arg(Complex *a)
{
    return atan(a->im/a->re);
}
void adcomplex(Complex *a, Complex*b)
{
    suma->re=a->re+b->re;
    suma->im=a->im+b->im;
}
void adcomplex(Complex a, Complex b)
{
    suma2.re=a.re+b.re;
    suma2.im=a.im+b.im;
}
Complex dif(Complex a, Complex b)
{
    double x,y;
    x=a.re-b.re;
    y=a.im-b.im;
    Complex d={x,y};
    return d;
}
bool equals(Complex *a, Complex *b)
{
    if ((a->re==b->re)&&(a->im==b->im)) return true;
    else return false;
}
